﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Engine
{
    public class Interface : Class
    {
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            //Build h file
            sb.AppendLine();
            sb.AppendLine("//Converted by dugongsoftware at codeplex.com ");
            sb.AppendLine("//");
            sb.AppendLine("#import <Foundation/Foundation.h>");
            sb.AppendLine();
            sb.AppendFormat("@interface {0} : NSObject", base.Name);
            sb.AppendLine();
            sb.AppendLine("{");

            foreach (Method method in base.Methods)
            {
                sb.AppendLine(method.ToString());
            }

            sb.AppendLine();

            //Do properties

            foreach (Property property in base.Properties)
            {
                sb.AppendLine(property.ToString());
                //if (methods[j].Name.StartsWith("get_"))
                //{
                //    String objectiveCType = Engine.TypeConvertor.ToObjectiveC(methods[j].ReturnType);
                //    sb.AppendFormat("@property (nonatomic, strong) {0} {1};", objectiveCType, methods[j].Name.Substring(4));
                //    sb.AppendLine();
                //}
            }

            sb.AppendLine();
            sb.AppendLine("}");
            sb.AppendLine();
            sb.AppendLine("@end");

            return sb.ToString();
        }
    }
}
